FIG. 1 shows a block diagram of a system for typical software development. In an object code generating method by a C compiler, as a modification portion of a source program (source code) becomes closer to the head of an address, a difference on the object code becomes greater, when the source program is modified. When the difference on the object code before and after the modification of the source program is great, the size of the code to be rewritten in a flash memory built in an embedded micro-computer is also large. For this reason, the efficiency of the object code generating method by the C compiler is desired to be made higher to minimize the difference.
For the object code generating method by the C compiler for the embedded micro-computer, a system for efficiently locating the object code is described in Patent Literature 1. FIG. 1 of the Patent Literature 1 shows a configuration diagram of a system which minimizes the number of rewrite blocks of the flash memory built in the embedded micro-computer, by minimizing the difference between the object codes generated before and after the modification of the source program, in a conventional software development.
The operation to generation of object code in the conventional technique will be described below in the following (1) to (6).
(1) Programs before and after a modification of a source program file are referred to as an old source program file and a new source program file, respectively, and both the files are compiled by using the C compiler.
(2) A block data file of a flash memory that is different for each device is prepared before compiling and is read.
(3) The C compiler refers to a difference in code size between the new and old source program files and a block configuration of the flash memory and generates the object code.
(4) When the code size of the object code increases in the new source program file, the C compiler replaces a portion modified in the new source program file with a branch command and generates the object code, and generate the object code in an added source program portion for a block in which the object code is arranged before the modification.(5) When a object code portion for the branch command is arranged over two blocks, a command arranged in a address ascending direction from an original location at which the branch command is arranged is moved to a new location corresponding to a block in which the object code has not been arranged before the modification, and the branch command is arranged at the original location.(6) When the new source program file is described to decrease the number of codes of the object code, the C compiler adds dummy commands for the number of codes of a removed source program file portion, to the removed source program file portion and then generates the object code.
When program development for the embedded system is assumed, an execution speed, an execution timing and the behavior on the execution of the modified program vary if the location in a memory is changed. Accordingly, a program portion in which any modification is not performed is required to be arranged in the same location as the location in a case of no modification, even after the modification. Also, in the case of the program which is arranged in the same location to which any modification is not performed, a test can be efficiently performed.
However, in the conventional technique, as a method of shifting the object code of a modified portion to a free region without changing the addresses of the non-modified potion of the object code, a jump command is generated as necessary while the object codes are compared, when the compiler complies the source program files before and after the modification. In this method, attention is paid to only the object size. Thus, a predetermined block data of a flash memory is separately required.
Also, as the related art, a method of comparing programs that allows a program modification data to be obtained as a logical data block for a design is described in Patent Literature 2. In this related art, defines items to be compared for each hierarchy structure of module, file, function and source code, as the logical structures on the design, in the program targeted for the comparison, and carries out the comparison. Also, the comparison result is once recorded as a program modification data in a modification content holding section. Also, from the program modification data of the modification content holding section, a modification data output data having a hierarchy structure is prepared and displayed.